<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\Comment */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="comment-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'content')->textarea(['rows' => 6]) ?>

    <!-- 状态 下拉菜单  在状态类中写一个getter方法 -->
    <?= $form->field($model, 'status')->dropDownList(\common\models\Commentstatus::find()
        ->select(['name','id'])
        ->orderBy('position')
        ->indexBy('id')
        ->column(),
        ['prompt'=>'请选择状态']); ?>

    <!-- 时间在model里自动生成
    //$form->field($model, 'create_time')->textInput()-->



    <!--  //用户id 文章id 不能修改
    <?//= $form->field($model, 'userid')->textInput() ?>
     <?//= $form->field($model, 'post_id')->textInput() ?>

-->

    <?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>



    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '创建' : '修改', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
